home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / A-B / AutoCat.cpt / AutoCat / background_2726.txt < prev    next >
Text File  |  1989-02-26  |  12KB  |  465 lines

  1. -- background: 2726 from stack: in
  2. -- bmap block id: 3935
  3. -- flags: 4000
  4. -- background id: 0
  5. -- name: Index Card Bkgnd
  6. ----- HyperTalk script -----
  7. on newCard
  8.   get bkgnd field "Index" of prev card       --index page #'s
  9.   add 1 to it
  10.   put it into bkgnd field "Index" of this card
  11. end newCard
  12.  
  13.  
  14. on openCard
  15.   set the cursor to 4
  16.  
  17.   --Keep pages orderly
  18.  
  19.   if the number of card buttons = 33 then
  20.     answer "Please move the extra button to a new page."
  21.   else
  22.     if the number of card buttons > 33 then
  23.       answer "Please move extra buttons to a new page."
  24.     end if
  25.   end if
  26.  
  27.   set the cursor to 4
  28.  
  29.   -- use this throwaway XCMD to place buttons on grid on card
  30.   -- written for increased speed only
  31.  
  32.   put 9 into basex
  33.   put 38 into basey
  34.   put 54 into offs
  35.   SortButtons (the number of card buttons),basex,basey,offs
  36.  
  37. end openCard
  38.  
  39.  
  40.  
  41.  
  42. -- part 1 (button)
  43. -- low flags: 00
  44. -- high flags: 0000
  45. -- rect: left=454 top=291 right=307 bottom=470
  46. -- title width / last selected line: 0
  47. -- icon id / first selected line: 0 / 0
  48. -- text alignment: 1
  49. -- font id: 0
  50. -- text size: 12
  51. -- style flags: 0
  52. -- line height: 16
  53. -- part name: Next
  54. ----- HyperTalk script -----
  55. on mouseUp
  56.   visual effect wipe left to black
  57.   visual effect dissolve very fast to white
  58.   go to next card in this background
  59. end mouseUp
  60.  
  61.  
  62.  
  63. -- part 2 (button)
  64. -- low flags: 00
  65. -- high flags: 0000
  66. -- rect: left=469 top=306 right=322 bottom=485
  67. -- title width / last selected line: 0
  68. -- icon id / first selected line: 0 / 0
  69. -- text alignment: 1
  70. -- font id: 0
  71. -- text size: 12
  72. -- style flags: 0
  73. -- line height: 16
  74. -- part name: Prev
  75. ----- HyperTalk script -----
  76. on mouseUp
  77.   visual effect wipe right to black
  78.   visual effect dissolve very fast to white
  79.   go to prev card in this background
  80. end mouseUp
  81.  
  82.  
  83.  
  84.  
  85. -- part 5 (field)
  86. -- low flags: 01
  87. -- high flags: 0000
  88. -- rect: left=456 top=29 right=46 bottom=482
  89. -- title width / last selected line: 0
  90. -- icon id / first selected line: 0 / 0
  91. -- text alignment: 0
  92. -- font id: 3
  93. -- text size: 9
  94. -- style flags: 0
  95. -- line height: 12
  96. -- part name: Index
  97.  
  98.  
  99. -- part 6 (button)
  100. -- low flags: 00
  101. -- high flags: 2000
  102. -- rect: left=399 top=26 right=47 bottom=422
  103. -- title width / last selected line: 0
  104. -- icon id / first selected line: 21847 / 21847
  105. -- text alignment: 1
  106. -- font id: 0
  107. -- text size: 12
  108. -- style flags: 0
  109. -- line height: 16
  110. -- part name: Home
  111. ----- HyperTalk script -----
  112. on mouseUp
  113.   visual effect iris close
  114.   go home
  115. end mouseUp
  116.  
  117.  
  118.  
  119.  
  120. -- part 7 (button)
  121. -- low flags: 00
  122. -- high flags: 2000
  123. -- rect: left=42 top=287 right=320 bottom=74
  124. -- title width / last selected line: 0
  125. -- icon id / first selected line: 21453 / 21453
  126. -- text alignment: 1
  127. -- font id: 0
  128. -- text size: 12
  129. -- style flags: 0
  130. -- line height: 16
  131. -- part name: Add Box
  132. ----- HyperTalk script -----
  133. -- create a file for a particular disk box
  134. on mouseUp
  135.   if the number of card buttons > 31 then
  136.     answer "Please create a new page."
  137.     exit mouseUp
  138.   end if
  139.  
  140.   -- name the file acceptably
  141.   put false into goodOne
  142.   repeat until goodOne
  143.     -- default is sequentially numbered box
  144.     ask "Please enter box name: " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
  145.     If it is empty then
  146.       exit mouseUp
  147.  
  148.       --make the name < 10 characters
  149.     else
  150.       if the length of it < 10 then
  151.         put it into boxName
  152.         put true into goodOne
  153.       else
  154.         repeat until goodOne
  155.           beep
  156.           ask "Please enter box name (<10 char.): " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
  157.           if it is empty then
  158.             exit mouseUp
  159.           else
  160.             if the length of it < 10 then
  161.               put it into boxName
  162.               put true into goodOne
  163.             end if
  164.           end if
  165.         end repeat
  166.       end if
  167.     end if
  168.   end repeat
  169.  
  170.   -- make a box button aimed at the new file
  171.   set lockScreen to true
  172.   choose button tool
  173.   doMenu New Button
  174.   set icon of button "New Button" to 24438 -- a disk box icon
  175.   set autoHilite of btn "New Button" to TRUE
  176.   set style of button "New Button" to transparent
  177.   set rect of button "New Button" to 219,142,274,197 -- stick in middle
  178.   set name of button "New Button" to boxName
  179.  
  180.   -- a hidden button that holds the generic script for the box
  181.   -- buttons which point to the appropriate file (cards)
  182.   get script of bkgnd button id 17
  183.   put it into scriptHolder
  184.  
  185.   -- stick the generic script & the right pointer into the new button
  186.   set script of button boxName to "on mouseUp"&return &"global hardDisk" &return&"put"&"e&boxName&&1"e&&"into cardNm"&return&"put" &"e&boxName&".Index""e&&"into indCardNm"&return&"put" &"e&boxName"e&&"into boxName"&return&"put false into hardDisk" &return&return&scriptHolder
  187.   send openCard to this card
  188.   choose browse tool
  189.   set lockScreen to false
  190. end mouseUp
  191.  
  192.  
  193.  
  194.  
  195.  
  196. -- part 13 (button)
  197. -- low flags: 00
  198. -- high flags: 2000
  199. -- rect: left=302 top=32 right=57 bottom=333
  200. -- title width / last selected line: 0
  201. -- icon id / first selected line: 19678 / 19678
  202. -- text alignment: 1
  203. -- font id: 0
  204. -- text size: 12
  205. -- style flags: 0
  206. -- line height: 16
  207. -- part name: Tell Me...
  208. ----- HyperTalk script -----
  209. on mouseUp
  210.   push card
  211.   visual effect dissolve
  212.   go to card id 7767
  213. end mouseUp
  214.  
  215.  
  216. -- part 11 (button)
  217. -- low flags: 00
  218. -- high flags: 2000
  219. -- rect: left=30 top=36 right=54 bottom=53
  220. -- title width / last selected line: 0
  221. -- icon id / first selected line: 6720 / 6720
  222. -- text alignment: 1
  223. -- font id: 0
  224. -- text size: 12
  225. -- style flags: 0
  226. -- line height: 16
  227. -- part name: Return
  228. ----- HyperTalk script -----
  229. on mouseUp
  230.   visual effect iris close
  231.   pop card
  232. end mouseUp
  233.  
  234.  
  235.  
  236. -- part 17 (button)
  237. -- low flags: 80
  238. -- high flags: 0000
  239. -- rect: left=159 top=37 right=49 bottom=171
  240. -- title width / last selected line: 0
  241. -- icon id / first selected line: 0 / 0
  242. -- text alignment: 1
  243. -- font id: 0
  244. -- text size: 12
  245. -- style flags: 0
  246. -- line height: 16
  247. -- part name: HoldTheScript
  248. ----- HyperTalk script -----
  249. --generic button script
  250. put false into flag
  251. put the ticks into originalTicks
  252.  
  253. repeat until the mouseClick -- flag a single click
  254.   if the ticks - originalTicks > 30 then
  255.     put true into flag -- single click
  256.     exit repeat
  257.   end if
  258. end repeat
  259. visual effect iris open
  260.  
  261. --begin with creating a box index card
  262. set cursor to 4
  263. put the ID of this card into toHome -- store this index card
  264. put false into frstCrd
  265. if flag contains false then -- double click
  266.   go to card CardNm -- first disk catalog card of box
  267.   if the result is not empty then
  268.     go to card indCardNm
  269.   end if
  270. else -- single click
  271.   go to card indCardNm -- box index card
  272. end if
  273.  
  274. if the result is not empty then
  275.   put true into frstCrd -- they don't exist yet
  276.   set lockMessages to true
  277.   set lockScreen to true
  278.   go to card id 5366 -- box index template
  279.   doMenu New Card
  280.   set the name of this card to indCardNm
  281.   put boxName into bkgnd field "Box Name"
  282.   put third word of toHome into bkgnd field "IndexCardID" -- index card
  283.   if hardDisk contains true then
  284.     put "true" into bkgnd field "Hard Disk?" -- floppy or HD box
  285.   else
  286.     put "false" into bkgnd field "Hard Disk?"
  287.   end if
  288.   set lockMessages to false
  289. end if
  290.  
  291. --create and go to first disk card if this is a new box
  292. if frstCrd contains true then
  293.  
  294.   -- start a new set of cards for the box
  295.   go to card cardNm
  296.   if the result is not empty then
  297.     set lockMessages to true
  298.     go to card id 3043
  299.     doMenu New Card
  300.     set the name of this card to cardNm
  301.     put word 1 to (the number of words in cardNm -1) of cardNm into bkgnd field "Box Name" of card cardNm -- index which box
  302.     put 1 into bkgnd field "PageOfBox" of card cardNm -- which disk number
  303.     -- which Index Box
  304.     put indCardNm into bkgnd field "Box Card" of card cardNm
  305.     if hardDisk contains true then -- Hard Disk?
  306.       put "true" into bkgnd field "Hard Disk?"
  307.       put "Page#:" into bkgnd field "Name Of Page"
  308.     else
  309.       put "false" into bkgnd field "Hard Disk?"
  310.       put "Disk#:" into bkgnd field "Name Of Page"
  311.     end if
  312.  
  313.     -- create an opaque button to cover up the arrow pointing to previous
  314.     -- card since this is the first disk catalog page and there will be no
  315.     -- previous disk catalog page
  316.     doMenu New Button
  317.     set rect of button "New Button" to 159,313,185,336
  318.     set style of button "New Button" to opaque
  319.     set showName of button "New Button" to false
  320.     set name of button "New Button" to "Cover Prev"
  321.     choose browse tool
  322.     set lockScreen to false
  323.     go to  card cardNm
  324.     --call ReadAutoCat
  325.     send openCard to card cardNm
  326.   end if
  327. end if
  328. end mouseUp
  329.  
  330.  
  331.  
  332. -- part 18 (button)
  333. -- low flags: 00
  334. -- high flags: 2000
  335. -- rect: left=239 top=288 right=321 bottom=269
  336. -- title width / last selected line: 0
  337. -- icon id / first selected line: 30527 / 30527
  338. -- text alignment: 1
  339. -- font id: 0
  340. -- text size: 12
  341. -- style flags: 0
  342. -- line height: 16
  343. -- part name: Find
  344. ----- HyperTalk script -----
  345. on mouseUp
  346.   searchAC 1  -- XFCN to bring up dialog box to set Find parameters
  347. end mouseUp
  348.  
  349.  
  350.  
  351. -- part 26 (button)
  352. -- low flags: 00
  353. -- high flags: 2000
  354. -- rect: left=86 top=286 right=320 bottom=122
  355. -- title width / last selected line: 0
  356. -- icon id / first selected line: 24342 / 24342
  357. -- text alignment: 1
  358. -- font id: 0
  359. -- text size: 12
  360. -- style flags: 0
  361. -- line height: 16
  362. -- part name: Add Box
  363. ----- HyperTalk script -----
  364. -- create a file for a particular disk box
  365. on mouseUp
  366.   if the number of card buttons > 31 then
  367.     answer "Please create a new page."
  368.     exit mouseUp
  369.   end if
  370.  
  371.   -- name the file acceptably
  372.   put false into goodOne
  373.   repeat until goodOne
  374.     -- default is sequentially numbered box name
  375.     ask "Please enter box name: " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
  376.     If it is empty then
  377.       exit mouseUp
  378.     else
  379.       -- make name < 10 characters
  380.       if the length of it < 10 then
  381.         put it into boxName
  382.         put true into goodOne
  383.       else
  384.         repeat until goodOne
  385.           beep
  386.           ask "Please enter box name (<10 char.): " with "Box #"&((the number of card buttons+1)+((bkgnd field "Index"-1)*32))
  387.           if it is empty then
  388.             exit mouseUp
  389.           else
  390.             if the length of it < 10 then
  391.               put it into boxName
  392.               put true into goodOne
  393.             end if
  394.           end if
  395.         end repeat
  396.       end if
  397.     end if
  398.   end repeat
  399.  
  400.   -- make a box button aimed at the new file
  401.   set lockScreen to true
  402.   choose button tool
  403.   doMenu New Button
  404.   set icon of button "New Button" to 23929 -- a hard disk box icon
  405.   set autoHilite of btn "New Button" to TRUE
  406.   set style of button "New Button" to transparent
  407.   set rect of button "New Button" to 219,142,274,197 -- stick in middle
  408.   set name of button "New Button" to boxName
  409.  
  410.   -- a hidden button that holds the generic script for the box
  411.   -- buttons which point to the appropriate file (cards)
  412.   get script of bkgnd button id 17
  413.   put it into scriptHolder
  414.  
  415.   -- stick the generic script & the right pointer into the new button
  416.   set script of button boxName to "on mouseUp"&return &"global hardDisk" &return&"put"&"e&boxName&&1"e&&"into cardNm"&return&"put" &"e&boxName&".Index""e&&"into indCardNm"&return&"put" &"e&boxName"e&&"into boxName"&return&"put true into hardDisk" &return&return&scriptHolder
  417.   send openCard to this card
  418.   choose browse tool
  419.   set lockScreen to false
  420. end mouseUp
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427. -- part 27 (button)
  428. -- low flags: 00
  429. -- high flags: 2000
  430. -- rect: left=411 top=286 right=319 bottom=439
  431. -- title width / last selected line: 0
  432. -- icon id / first selected line: 15084 / 15084
  433. -- text alignment: 1
  434. -- font id: 0
  435. -- text size: 12
  436. -- style flags: 0
  437. -- line height: 16
  438. -- part name: Appl Paths
  439. ----- HyperTalk script -----
  440. on mouseUp
  441.   push card
  442.   visual effect iris open
  443.   go to bkgnd ID 6410
  444. end mouseUp
  445.  
  446.  
  447.  
  448. -- part 28 (button)
  449. -- low flags: 00
  450. -- high flags: 2000
  451. -- rect: left=372 top=287 right=318 bottom=404
  452. -- title width / last selected line: 0
  453. -- icon id / first selected line: 17747 / 17747
  454. -- text alignment: 1
  455. -- font id: 0
  456. -- text size: 12
  457. -- style flags: 0
  458. -- line height: 16
  459. -- part name: Print Button
  460. ----- HyperTalk script -----
  461. on mouseUp
  462.   doMenu "Print Report..."
  463. end mouseUp
  464.  
  465.